package com.zlx.mall.basic.datasource.model;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @author qingke
 **/
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
public class ModifyBaseRequest extends PrimaryKeyBaseRequest
        implements java.io.Serializable {

    /**
     * 状态
     */
    protected Integer status;
    /**
     * 排序
     */
    protected Integer sort;
    /**
     * 是否删除
     */
    protected Boolean deleted;

    public boolean isStatus() {
        return isUpdate() && Objects.nonNull(status);
    }

    public boolean isSort() {
        return isUpdate() && Objects.nonNull(sort);
    }

    public boolean isDelete() {
        return isUpdate() && Boolean.TRUE.equals(deleted);
    }

}
